package status 
{
	import pure.engine.renderer.AnimationRenderer;
	import pure.engine.status.motion.PlatformMotion;
	import pure.engine.status.Status;
	import pure.engine.system.ns_despair;
	
	use namespace ns_despair;
	
	/**
	 * ...
	 * @author Pure
	 */
public class PlatformStatus extends PlatformMotion 
{
	
	public function PlatformStatus(maxHoriVel:Number, gravity:Number = 16 , maxVerticalVel:Number = 140, forceFactor:Number = 0.1, frictionFactor:Number = 0.15) 
	{
		super(maxHoriVel, gravity, maxVerticalVel, forceFactor, frictionFactor);
	}
		
	public static const GO_LEFT:String = 'goLeft';
	public static const GO_RIGHT:String = 'goRight';
	public static const JUMP:String = 'jump';
	public static const STOP:String = 'stop';
	
	private var R:AnimationRenderer;
	
	
	override public function absorb():void
	{
		R = _entity.headRenderer as AnimationRenderer;

	}

	
	override public function onTick(elapsedT:Number):void 
	{
		super.onTick(elapsedT);
		if (this.jumping)
		{
			if (this.orientation == 'L')
			{
				R.play('left_jump');

			}
			else
			{
				R.play('right_jump');

			}

		}
		
		if (this.falling)
		{
			if (this.orientation == 'L')
			{
				R.play('left_fall');

			}
			else
			{
				R.play('right_fall');

			}
		}
		
		if (this.justLanded)
		{
			if (this.orientation == 'L')
			{
				R.play('left_stand');

			}
			else
			{
				R.play('right_stand');

			}
		}

	}
}

}